﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace YasharEl.Infrastructure.ResourcesManagement.Managers
{
    /// <summary>
    /// ResourceFileRef manages resource file references
    /// </summary>
    [Serializable]
    public class ResourceFileRef : IResourceFileRef
    {
        #region Fields

        private string fileName;
        private string typeName;
        private Encoding textFileEncoding;

        #endregion

        #region Constructors

        /// <summary>
        /// Constructs a ResourceFileRef object
        /// </summary>
        /// <param name="fileName">The name of the file in the file reference</param>
        /// <param name="typeName">The string of the type of data in the file</param>
        public ResourceFileRef(string fileName, string typeName)
        {
            this.fileName = fileName;
            this.typeName = typeName;
        }

        /// <summary>
        /// Constructs a ResourceFileRef object
        /// </summary>
        /// <param name="fileName">The name of the file in the file reference</param>
        /// <param name="typeName">The string of the type of data in the file</param>
        /// <param name="textFileEncoding">The encoding mechanism of the file if the file is a text file</param>
        public ResourceFileRef(string fileName, string typeName, Encoding textFileEncoding)
            : this(fileName, typeName)
        {
            this.textFileEncoding = textFileEncoding;
        }

        #endregion

        #region Properties

        /// <summary>
        /// FileName is the name of the file in the file reference
        /// </summary>
        public string FileName
        {
            get { return fileName; }
            set { fileName = value; }
        }

        /// <summary>
        /// TypeName is the string of the type of data in the file
        /// </summary>
        public string TypeName
        {
            get { return typeName; }
            set { typeName = value; }
        }

        /// <summary>
        /// TextFileEncoding is the encoding mechanism of the file if the file is a text file
        /// </summary>
        public Encoding TextFileEncoding
        {
            get { return textFileEncoding; }
            set { textFileEncoding = value; }
        }

        #endregion
    }
}
